* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 400px;
    height: 600px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
}

.tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-content {
    display: none;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.section h4 {
    color: #6c757d;
    margin: 15px 0 10px 0;
    font-size: 14px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-group label input[type="checkbox"],
.form-group label input[type="radio"] {
    margin-right: 8px;
    margin-bottom: 0;
}

.form-group label:has(input[type="checkbox"]),
.form-group label:has(input[type="radio"]) {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    min-height: 80px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 8px;
    margin-bottom: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-copy {
    background: #28a745;
    color: white;
}

.btn-copy:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-group {
    margin-bottom: 15px;
}

.result {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 15px;
}

.result input {
    flex: 1;
    background: #f8f9fa;
    border-color: #dee2e6;
}

.cron-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.cron-test {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.test-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.test-input-group input {
    flex: 1;
}

#cronTestResult {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #495057;
    min-height: 40px;
}

#cronTestResult .success-message {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 10px;
}

#cronTestResult .error-message {
    color: #dc3545;
    font-weight: 600;
}

.cron-time-list {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
}

.cron-time-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f1f3f4;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.cron-time-item:last-child {
    border-bottom: none;
}

.cron-time-index {
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.cron-time-value {
    color: #495057;
    font-weight: 500;
}

/* 格式化工具子标签样式 */
.format-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.format-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    flex: 1;
}

.format-tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.format-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

.format-tab-content {
    display: none;
}

.format-tab-content.active {
    display: block;
}

/* 滚动条样式 */
.tab-content::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式调整 */
@media (max-width: 420px) {
    .container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .tab-btn {
        font-size: 11px;
        padding: 10px 6px;
    }
    
    .cron-builder {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

/* 成功提示样式 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 8px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 8px;
    border: 1px solid #f5c6cb;
}